<?php

if(! defined('OT_ROOT')) {
	exit('Access Denied');
}


class AppXcxGoods{
	public static $appName = '小程序商品';
	public static $appID = 176;

	public static function Jud(){
		return false;
	}

	public static function Show($str, $def=''){
			return $def;
	}

	public static function TypeArr(){
		return array(
			array('type'=>'taobao',		'name'=>'淘宝',		'color'=>'#be1919'),
			array('type'=>'jingdong',	'name'=>'京东',		'color'=>'#2979ff'),
			array('type'=>'pinduoduo',	'name'=>'拼多多',	'color'=>'#2979ff')
			);
	}

	public static function TypeOption($def=''){
		$typeArr = self::TypeArr();

		$retStr = '';
		foreach ($typeArr as $val){
			$retStr .= '<option value="'. $val['type'] .'" '. Is::Selected($val['type'], $def) .'>'. $val['name'] .'</option>';
		}
		return $retStr;
	}

	public static function TypeItem($str, $type='name'){
		$typeArr = self::TypeArr();

		foreach ($typeArr as $val){
			if ($val['type'] == $str){
				if (! in_array($type, array('name','color'))){ $type = 'name'; }
				return $val[$type];
			}
		}
		return '['. $str .','. $type .']';
	}

	public static function TypeJud($str){
		$typeArr = self::TypeArr();

		foreach ($typeArr as $val){
			if ($val['type'] == $str){
				return true;
			}
		}
		return false;
	}


	public static function List(){
		$dataArr	= array('res' => false, 'note' => '', 'size' => 0, 'page' => 0, 'pageCount' => 0, 'count' => 0, 'dataCount' => 0, 'data' => array());
		$dataArr['res']		= false;
		$dataArr['note']	= StrInfo::AlertStr('noApp');
		$dataArr['size']	= 0;
		$dataArr['page']	= 0;

		die( json_encode($dataArr) );
	}

	public static function Send(){
		$dataArr = array();
		$dataArr['res']		= false;
		$dataArr['note']	= StrInfo::AlertStr('noApp');
		$dataArr['data']	= null;

		die( json_encode($dataArr) );
	}

	public static function Deal(){
		$dataArr = array();
		$dataArr['res']		= false;
		$dataArr['note']	= StrInfo::AlertStr('noApp');
		$dataArr['data']	= null;

		die( json_encode($dataArr) );
	}

	public static function Del(){
		$dataArr = array();
		$dataArr['res']		= false;
		$dataArr['note']	= StrInfo::AlertStr('noApp');

		die( json_encode($dataArr) );
	}

	public static function Kouling(){
		$dataArr = array();
		$dataArr['res']		= false;
		$dataArr['note']	= StrInfo::AlertStr('noApp');
		$dataArr['data']	= array();

		die( json_encode($dataArr) );
	}
}
?>